Skip to content

feat: expose report-failure-as-issue as workflow_call input#1397

Merged
v1v merged 5 commits into
mainfrom
copilot/feat-expose-report-failure-as-issue
Jun 26, 2026
Merged

feat: expose report-failure-as-issue as workflow_call input#1397
v1v merged 5 commits into
mainfrom
copilot/feat-expose-report-failure-as-issue

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Repos consuming gh-aw-*.lock.yml via workflow_call had no way to disable failure→issue reporting — GH_AW_FAILURE_REPORT_AS_ISSUE was hardcoded to "true" in every compiled lock file with no input or variable fallback.

Changes

  • 52 gh-aw-*.md workflow source filesreport-failure-as-issue boolean input added directly to the workflow_call: inputs: block of each published workflow. This is the canonical source of truth for the input.

  • Makefile — wires scripts/wire-report-failure-input.sh into make compile, running after backwards-compat.sh so recompilation stays consistent.

  • scripts/wire-report-failure-input.sh — new post-compile shell script that replaces the compiler-hardcoded GH_AW_FAILURE_REPORT_AS_ISSUE: "true" with an expression reading from the input. Only processes lock files that define the report-failure-as-issue input; skips internal-only workflows without workflow_call: (agent-deep-dive, agent-efficiency). Note: the gh-aw compiler hard-codes this env var regardless of inputs defined in the frontmatter, so this wiring step remains necessary.

  • 58 gh-aw-*.lock.yml files — regenerated via make compile; report-failure-as-issue input added (default: true) and env var updated:

    GH_AW_FAILURE_REPORT_AS_ISSUE: ${{ inputs.report-failure-as-issue && 'true' || 'false' }}
  • 49 gh-agent-workflows/*/README.md + 8 docs/workflows/gh-agent-workflows/*.md — new input documented in all inputs tables.

Consumer usage

jobs:
  run:
    uses: elastic/ai-github-actions/.github/workflows/gh-aw-issue-triage.lock.yml@v0
    with:
      report-failure-as-issue: false

Default behavior is unchanged — repos that don't pass the input continue to get true.

- Add `report-failure-as-issue` boolean input (default: true) to all
  58 compiled gh-aw-*.lock.yml workflow_call triggers
- Replace hardcoded `GH_AW_FAILURE_REPORT_AS_ISSUE: "true"` with
  `${{ inputs.report-failure-as-issue && 'true' || 'false' }}`
- Add scripts/inject-report-failure-input.py for regenerating this
  transformation after `gh-aw compile`
- Wire the script into `make compile` (runs after backwards-compat.sh)
- Update gh-agent-workflows/*/README.md and
  docs/workflows/gh-agent-workflows/*.md to document the new input

Closes #1396
Copilot AI changed the title [WIP] Expose report-failure-as-issue as a workflow_call input feat: expose report-failure-as-issue as workflow_call input Jun 24, 2026
Copilot finished work on behalf of v1v June 24, 2026 10:36
Copilot AI requested a review from v1v June 24, 2026 10:36
@v1v
v1v marked this pull request as ready for review June 24, 2026 10:39
@v1v
v1v requested a review from fr4nc1sc0-r4m0n June 24, 2026 10:44
@v1v

v1v commented Jun 24, 2026

Copy link
Copy Markdown
Member

@copilot you should not use th epython script as post-compile step, but include the new input in the workflow_call in each agentic workflow (md files) then run the gh aw compile

@github-actions github-actions Bot added the medium_boom Medium PR blast radius; likely benefits from human review label Jun 24, 2026

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot you should not use th epython script as post-compile step, but include the new input in the workflow_call in each agentic workflow (md files) then run the gh aw compile

Done — reworked in commit refactor: add report-failure-as-issue input to .md sources, replace Python injector with shell script.

The report-failure-as-issue input is now defined directly in all 52 gh-aw-*.md source files under workflow_call: inputs:. Running make compile regenerates the lock files with the input from source.

One note: the gh-aw compiler hard-codes GH_AW_FAILURE_REPORT_AS_ISSUE: "true" regardless of inputs defined in the frontmatter, so the Python injector's env-var rewrite is still needed to wire the input to the env var. I replaced the Python script with a minimal shell script (scripts/wire-report-failure-input.sh) that does only that one substitution, similar in style to backwards-compat.sh.

Copilot finished work on behalf of v1v June 24, 2026 11:08
@github-actions

Copy link
Copy Markdown
Contributor

Note

The pull request was not created — a fallback review issue was created instead due to protected file changes: #1400

Done. Changes vs. previous approach on this branch:

Before: scripts/inject-report-failure-input.py ran as a post-compile step to inject the report-failure-as-issue input into compiled lock files.

After: The input is declared directly in each of the 52 gh-aw-*.md source files under workflow_call.inputs, so gh aw compile includes it naturally in the lock files. The Python script is deleted.

Makefile: The Python call is replaced with a concise inline sed step that wires GH_AW_FAILURE_REPORT_AS_ISSUE to the input expression. This step is still needed because the gh-aw compiler v0.80.9 emits a static true/false based on safe-outputs.report-failure-as-issue boolean, not a dynamic expression. If compiler support is added in future, the sed step can be removed.


What is this? | From workflow: Mention in Issue (no sandbox)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@fr4nc1sc0-r4m0n fr4nc1sc0-r4m0n left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@v1v

v1v commented Jun 25, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

…eport-failure-as-issue

# Conflicts:
#	.github/workflows/gh-aw-internal-gemini-cli-web-search.lock.yml
#	.github/workflows/gh-aw-internal-gemini-cli.lock.yml
#	.github/workflows/gh-aw-issue-fixer.lock.yml
#	.github/workflows/gh-aw-issue-triage.lock.yml
#	.github/workflows/gh-aw-mention-in-issue-by-id.lock.yml
#	.github/workflows/gh-aw-mention-in-issue-no-sandbox.lock.yml
#	.github/workflows/gh-aw-mention-in-issue.lock.yml
#	.github/workflows/gh-aw-mention-in-pr-no-sandbox.lock.yml
#	.github/workflows/gh-aw-mention-in-pr.lock.yml
#	.github/workflows/gh-aw-plan.lock.yml

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Done — merged origin/main into the branch in commit e2219c7. The 10 conflicted lock files all had single-line conflicts on the # gh-aw-metadata: hash (because both branches changed the same source .md files). Resolved by taking main's metadata hash for each file while preserving the merged content (main's trigger removals + this PR's report-failure-as-issue input and env var expression).

Copilot finished work on behalf of v1v June 25, 2026 15:26
@v1v

v1v commented Jun 25, 2026

Copy link
Copy Markdown
Member

@copilot analyse https://github.com/elastic/ai-github-actions/actions/runs/28181135241/job/83473618479?pr=1397 and run the make compile or similar comment to redo the changes

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot analyse https://github.com/elastic/ai-github-actions/actions/runs/28181135241/job/83473618479?pr=1397 and run the make compile or similar comment to redo the changes

The CI failure was caused by a metadata hash mismatch in the 10 lock files that had merge conflicts — the merge resolution had taken origin/main's hash, but the files' actual content reflected the merged state (both branches' changes). CI's make compile check detected the inconsistency.

Fixed in d06c586 by running make compile locally to recompile all 10 affected lock files with the correct metadata hashes.

@v1v
v1v merged commit f4a5240 into main Jun 26, 2026
26 checks passed
@v1v
v1v deleted the copilot/feat-expose-report-failure-as-issue branch June 26, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

medium_boom Medium PR blast radius; likely benefits from human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants